import request from '@/utils/http'

export function queryByKey() {
  return request.get({
    url: '/api/app/global/config/queryByKey?configKey=hw_health_kit_scopes'
  })
}
// 授权接口
export function getToken(data) {
  return request.post({
    url: '/api/huawei/health/kit/getToken',
    data
  })
}
// 获取授权状态
export function getTokenStatus(data) {
  return request.post({
    url: '/api/huawei/health/kit/getTokenStatus',
    data
  })
}
// 取消授权
export function deleteToken(data: any) {
  return request.post({
    url: '/api/huawei/health/kit/deleteToken',
    data
  })
}
// 带授权状态的患者列表
export const huawei_patient = (params: any) => {
  return request.get({
    url: '/api/huawei/health/kit/huawei/list/patient?userId=' + params
    // data: params
  })
}
// 授权列表
export const auth_patient = (params: any) => {
  return request.get({
    url: '/api/huawei/health/kit/tokenList?userId=' + params,
  })
}
// 手动同步
export const sync_manual = (params: any) => {
  return request.post({
    url: '/api/huawei/health/kit/sync/manual',
    data: params
  })
}